package com.spittr.web;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.spittr.exceptions.ArgumentsIllegaleException;

@ControllerAdvice
public class GlobalControllerAdvice {
	
	@ExceptionHandler(ArgumentsIllegaleException.class)
	@ResponseStatus(HttpStatus.OK)  
	@ResponseBody
	public String retrunMsg(){
		return "home";
	}
	
//	@ExceptionHandler(RuntimeException.class)
//	@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)  
//	@ResponseBody
//	public String runtimeExceptionMsg(){
//		return "runtime";
//	}

}
